#ifndef TIMER_HANDLER_H_
#define TIMER_HANDLER_H_

#include "lpc_types.h"

/* ------------------------------------------------------------------------ */
// it was impossible to create a fully protected library
// in which every user cannot interfere with other user's timers
// however, it was done to some degree, so please
// do not abuse deinit function too much
//
// also not, that if the routines require too much processing power
// the timers may, or may not execute at the defined rates
//
// all timers have the same priority at the process level
/* ------------------------------------------------------------------------ */

void init_timer(void);
// self explicit
void deinit_timer(void);
// disables all the timers and resets all the flags to initial states;
uint16_t enable_timer(uint32_t, uint32_t, void (*)(void));
// enables a timer;
// args: prescale value, match value, a function to call on interrupt;
//returns a 'pointer' to the timer (for deinitialisation), 
void disable_timer(uint16_t);
// disables the timers, supplied the pointer given on enabling

#endif
